import { stringify } from 'qs';
import request from '@/utils/request';

// 二号期权
export async function getFundTwoList(province) {
  return request(
    `/admin/Ajax/Data/FundOptionCenter.ashx?method=GetList&name=&type=2&field=${province.field}&adesc=${province.adesc}`,
    {
      method: 'get',
    }
  );
}
// 肆号期权
export async function getFundFourList(province) {
  return request(
    `/admin/Ajax/Data/FundOptionCenter.ashx?method=GetList&name=&type=4&field=${province.field}&adesc=${province.adesc}`,
    {
      method: 'get',
    }
  );
}
/* export async function getFundTwoTradeList(province) {
  return request(`/admin/Ajax/Data/FundTwoTradeCenter.ashx?method=GetList&name=&type=3&page=`+province.page+"&pagesize="+province.pagesize,{
    method: 'get',
  });
}; */
// 获取二号股票列表
export async function getFundTwoTradeList(province) {
  return request(`/admin/Ajax/Data/FundTradeCenter.ashx?method=GetList&name=&type=2`, {
    method: 'get',
  });
}

// 获取四号股票列表
export async function getFundFourTradeList(province) {
  return request(`/admin/Ajax/Data/FundTradeCenter.ashx?method=GetList&name=&type=4`, {
    method: 'get',
  });
}

// 获取生物科技股票列表
export async function getBiologicalScienceList(province) {
  return request(`/admin/Ajax/Data/FundTradeCenter.ashx?method=GetList&name=&type=6`, {
    method: 'get',
  });
}

// 高权力金
export async function getHighPremiumsList(province) {
  return request(
    `/admin/Ajax/Data/FundOptionCenter.ashx?method=GetList&name=&type=7&field=${province.field}&adesc=${province.adesc}`,
    {
      method: 'get',
    }
  );
}

// 票据列表
export async function getBillGrade(province) {
  return request(`/fss/CxBill/BillGrade`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

// 风控 票据
export async function getBillRiskManage(province) {
  return request(`/fss/CxBill/BillRiskManage`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

// 票据列表
export async function uploadBill(province) {
  return request(`/fss/CxBill/BillUpInit`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

// 票据列表
export async function ryupload(province) {
  return request(`/fss/CxBill/BillUpdate`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

// 获取 RCN 或者 Twin票据列表
export async function getRYUpload(province) {
  return request(`/fss/CxBill/Bills`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

// 获取 股票敞口 列表
export async function getStockPer(province) {
  return request(`/fss/CxBill/StockPer`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}
// 獲取 RCN敞口 列表
export async function getRcnStockPer(province) {
  return request(
    `/fss/CxBill/RcnStockPer
  `,
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json;charset=utf-8',
      },
      body: JSON.stringify(province),
    }
  );
}

// 行业占比
export async function getIndustryPer(province) {
  return request(`/fss/CxBill/IndustryPer`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    // body:JSON.stringify(province)
  });
}

export async function safeBill(province) {
  return request(`/fss/CxBill/SafeBill`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}
// 跌破执行价的票据
export async function dangerBill1(province) {
  return request(`/fss/CxBill/DangerBill1`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}
// 距离执行价比例<=5%的票据
export async function dangerBill2(province) {
  return request(`/fss/CxBill/DangerBill2`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

export async function bgAddBillData(province) {
  console.log('参数=', province);

  return request(`/fss/CxBill/BgAddBillData`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

export async function expireBillGrade(province) {
  return request(`/fss/CxBill/ExpireBillGrade`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

export async function bgDeleteBillData(province) {
  return request(`/fss/CxBill/BgDeleteBillData`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}

export async function bgUpdateBillData(province) {
  return request(`/fss/CxBill/BgUpdateBillData`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(province),
  });
}
//protect
export async function buildProtect(param) {
  return request(`/fss/RcnProtect/BuildProtect`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(param),
  });
}

export async function getProtectList(param) {
  return request(`/fss/RcnProtect/GetProtectList?type=`+param, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}
export async function getOtionInfo() {
  return request(`/fss/ErveryProfit/GetOptionInfo?type=2`, {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
  });
}export async function getMvCurve(param) {
  return request(`/fss/CxBill/mvCurve`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
    },
    body: JSON.stringify(param),
  });
}
